<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018\9\27 0027
 * Time: 10:20
 */

namespace app\Lib;


use think\Env;

class Config
{
    /**
     * 获取系统默认配置  优先从$_SERVER里面取如果没有则从.env里面取
     * @param string $name
     * @param null $default
     * @return string
     */
    public static function get($name,$default = null)
    {
        if (  isset($_SERVER[$name]) ) {
            $result=$_SERVER[$name];
        }
        elseif (  isset($_SERVER["REDIRECT_".$name]) ) {
            $result=$_SERVER["REDIRECT_".$name];
        }else{
            $result=Env::get($name,$default);
        }

        return $result;
    }
}